package com.lanou.service.impl;

import com.lanou.bean.ArticleContent;
import com.lanou.bean.ArticleInfor;
import com.lanou.bean.CompanyPro;
import com.lanou.mapper.CompanyInfoMapper;
import com.lanou.service.CompanyInfoService;
import com.lanou.utils.AjaxResult;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by dllo on 18/3/12.
 */
@Service
public class CompanyInfoServiceImpl implements CompanyInfoService {
    @Resource
    private CompanyInfoMapper companyInfoMapper;
    /**
     * 此接口是显示这个装修公司简介的数据
     * id是此公司在数据库的主键
     * 开发人:赵帅
     */
    @Override
    public AjaxResult getCompanyPro(Integer id) {
        AjaxResult ajaxResult = new AjaxResult();
        ajaxResult.setCode("200");
        ajaxResult.setMsg("公司简介");
        ajaxResult.setData(companyInfoMapper.getCompanyPro(id));
        return ajaxResult;
    }

    /**
     *
     * @param id 公司的id号
     * @return 返回公司资质证书的图片链接
     * 开发人:赵帅
     */
    @Override
    public AjaxResult getQualifcation(int id) {
        AjaxResult ajaxResult = new AjaxResult();
        ajaxResult.setCode("200");
        ajaxResult.setMsg("公司资质证书");
        ajaxResult.setData(companyInfoMapper.getQualifcation(id));
        return ajaxResult;
    }

    /**
     *
     * @param id 公司Id
     * @return 公司营业执照图片信息
     * 开发人:赵帅
     */
    @Override
    public AjaxResult getBusinessLicence(int id) {
        AjaxResult ajaxResult = new AjaxResult();
        ajaxResult.setCode("200");
        ajaxResult.setMsg("公司营业执照");
        ajaxResult.setData(companyInfoMapper.getBusinessLic(id));
        return ajaxResult;
    }

    /**
     *
     * @param id
     * @return 公司荣誉证书图片地址
     * 开发人:赵帅
     */
    @Override
    public AjaxResult getHonorCer(int id) {
        AjaxResult ajaxResult = new AjaxResult();
        ajaxResult.setCode("200");
        ajaxResult.setMsg("公司荣誉证书");
        ajaxResult.setData(companyInfoMapper.getHonorCer(id));
        return ajaxResult;
    }

    /**
     *
     * @param id
     * @return 公司的注册信息
     * 开发人:赵帅
     */
    @Override
    public AjaxResult getRegistMsg(int id) {
        AjaxResult ajaxResult = new AjaxResult();
        ajaxResult.setCode("200");
        ajaxResult.setMsg("公司注册信息");
        ajaxResult.setData(companyInfoMapper.getRegistMsg(id));
        return ajaxResult;
    }

    /**
     *
     * @param id 公司id
     * @return 此公司的文章资讯和内容
     * 开发人:赵帅
     */
    @Override
    public AjaxResult getArticles(int id) {
        AjaxResult ajaxResult = new AjaxResult();
        ajaxResult.setCode("200");
        ajaxResult.setMsg("公司的文章资讯");
        ajaxResult.setData(companyInfoMapper.getArticles(id));
        return ajaxResult;
    }


    /**
     *
     * @param id 公司id
     * @return 此公司的装修优惠信息单
     * 开发人:赵帅
     */
    @Override
    public AjaxResult getDecorateFavour(int id) {
        AjaxResult ajaxResult = new AjaxResult();
        ajaxResult.setCode("200");
        ajaxResult.setMsg("装修优惠信息");
        ajaxResult.setData(companyInfoMapper.getFavourInfo(id));
        return ajaxResult;
    }

    /**
     * @param id 公司id
     * @return 联系方式信息
     * 开发人:赵帅
     */
    @Override
    public AjaxResult getContact(int id) {
        AjaxResult ajaxResult = new AjaxResult();
        ajaxResult.setCode("200");
        ajaxResult.setMsg("联系方式");
        ajaxResult.setData(companyInfoMapper.getContact(id));
        return ajaxResult;
    }
}
